import 'package:flutter/material.dart';

class TopNavBar extends StatefulWidget {
  String title;
  Widget child;
  final GestureTapCallback? onPressRight;

  TopNavBar({Key? key, required this.title, required this.child, GestureTapCallback? this.onPressRight})
      : super(key: key);

  @override
  _TopNavBarState createState() => _TopNavBarState();
}

class _TopNavBarState extends State<TopNavBar> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
        centerTitle: true,
        shadowColor: Color.fromARGB(0, 0, 0, 0),
        backgroundColor: Color.fromARGB(255, 246, 249, 251),
        titleTextStyle: TextStyle(color: Colors.black87, fontSize: 20.0, fontWeight: FontWeight.w600),
        actions: [
          IconButton(onPressed: widget.onPressRight, icon: const Icon(Icons.list))
        ],
        actionsIconTheme: IconThemeData(color: Color.fromARGB(255, 113, 165, 194)),
      ),
      body: widget.child,
    );
  }
}

class _EmptyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container();
  }
}
